package com.huike.web.controller.report;

import com.baomidou.mybatisplus.extension.api.R;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.result.Result;
import com.huike.report.domain.vo.LineChartVo;
import com.huike.report.domain.vo.VulnerabilityMapVo;
import com.huike.report.result.ReportSalesOwnerShipStatisticsListData;
import com.huike.report.service.ReportService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description 统计分析相关接口
 * @Date 2023-10-10
 */

@RestController
@Slf4j
@RequestMapping("/report")
@RequiredArgsConstructor
public class ReportController {

    @Resource
    private ReportService reportService;

    @GetMapping("/getVulnerabilityMap/{beginCreateTime}/{endCreateTime}")
    public Result<VulnerabilityMapVo> getVulnerabilityMap(@PathVariable String beginCreateTime, @PathVariable String endCreateTime) {

        return Result.success(null);
    }

    /**
     * 销售统计报表接口
     *
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
//    @GetMapping("/salesStatistics/{beginCreateTime}/{endCreateTime}")
//    @ApiOperation("销售统计报表接口")
//    public LineChartVo statistics(@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") String beginCreateTime,
//                                  @PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") String endCreateTime) {
//        log.info("开始执行销售统计报表接口,开始日期：{},结束日期：{}", beginCreateTime, endCreateTime);
//        // 传入两个时间进行统计
//        LineChartVo lineChartVo = reportService.statisticsMoney(beginCreateTime, endCreateTime);
//        return lineChartVo;
//    }

//    @GetMapping("/ownerShipStatisticsList/{beginCreateTime}/{endCreateTime}")
//    @ApiOperation("销售统计归属人报表")
//    public TableDataInfo<List<ReportSalesOwnerShipStatisticsListData>> ownerShipStatisticsList(@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") String beginCreateTime,
//                                                                                               @PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") String endCreateTime) {
//        log.info("开始执行销售统计归属人报表接口,开始日期：{},结束日期：{}", beginCreateTime, endCreateTime);
//        // 传入两个时间进行统计
//        List<ReportSalesOwnerShipStatisticsListData> list = reportService.statisticsByPeople(beginCreateTime, endCreateTime);
//        return new TableDataInfo<>(list, list.size());
//    }
}
